/*
 * AccessControlList.java
 *
 * Copyright©2012 JMAS corporation. All rights reserved.
 */
package jp.co.jmas.jmasvideo.jaxb;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement
@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
public class AccessControlList {

	@XmlElement(name = "Owner")
	private Owner owner;

	@XmlElement(name = "Entries", required = true)
	private final Entries entries = new Entries();

	/**
	 * @return the owner
	 */
	public Owner getOwner() {
		return owner;
	}

	/**
	 * @param owner the owner to set
	 */
	public void setOwner(Owner owner) {
		this.owner = owner;
	}

	public List<Entry> getEntryList() {
		return entries.getEntryList();
	}

	@XmlType
	@XmlAccessorType(XmlAccessType.FIELD)
	private static class Entries {
		@XmlElement(name = "Entry")
		private List<Entry> entryList;

		public synchronized List<Entry> getEntryList() {
			if (entryList == null) {
				entryList = new ArrayList<Entry>();
			}
			return entryList;
		}
	}
}
